External APIs
Build full-stack applications by calling external APIs with environment variables.
You can call external services in your v0 prototypes by storing access keys as environment variables. This works for both third-party and your own APIs.
Adding API keys
- Click Vars on the chat sidebar
- Click Add to create a new environment variable
- Select the environments where the variable should be available
- Enter the Name (e.g.
API_KEY) and Value for your key - Click Add Variables to save

Environments
When adding a variable, you can choose which environments it applies to:

This lets you use different API keys for testing vs production, or enable features only in certain environments.
| Environment | Description |
|---|---|
| Production | Applied to your live, published app |
| Preview | Applied to preview deployments (non-production branches) |
| Development | Used when running your project locally |
Environment variables are encrypted and stored securely on Vercel. Once added, you can instruct v0 to use them in your API calls.
Learn more about environment variables

